<h1 matDialogTitle>{{ 'Leave Domain' | translate }}</h1>
<form class="ix-form-container" [formGroup]="form" (submit)="onSubmit()">
  <p>
    {{ 'Leaving the domain requires sufficient privileges. Enter your credentials below.' | translate }}
  </p>

  <ix-input
    formControlName="username"
    [required]="true"
    [label]="'Username' | translate"
  ></ix-input>

  <ix-input
    formControlName="password"
    [required]="true"
    [label]="'Password' | translate"
    [type]="'password'"
  ></ix-input>

  <ix-form-actions>
    <button mat-button type="button" matDialogClose ixTest="cancel">
      {{ 'Cancel' | translate }}
    </button>
    <button
      *ixRequiresRoles="[Role.DirectoryServiceWrite]"
      mat-button
      type="submit"
      color="primary"
      ixTest="leave-domain"
      [disabled]="form.invalid"
    >
      {{ 'Leave Domain' | translate }}
    </button>
  </ix-form-actions>
</form>
